<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <title>Degradable Pages | Raxan User Guide</title>
    <link href="../raxan/styles/master.css" rel="stylesheet" type="text/css" />
    <!--[if IE]><link rel="stylesheet" href="../raxan/styles/master.ie.css" type="text/css"><![endif]-->
    <link href="style.css" rel="stylesheet" type="text/css" />
    <link href="highlight/styles/default.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="highlight/highlight.js"></script>
    <script type="text/javascript">
        hljs.initHighlightingOnLoad('javascript','html','php');
    </script>

</head>

<body>
    <div class="container c48 prepend-top">
        <h2 class="bottom">Raxan User Guide</h2>
        <div class="navbar">
            <div class="lf"><div class="rt"><div class="md">
                <ul>
                    <li><a href="../index.html" title="The Rich Ajax, CSS &amp; PHP Framework" >Home</a></li>
                    <li><a href="table-of-contents.html" title="Blog Posts" >Table Of Contents</a></li>
                    <li><a href="../php-examples/index.php" title="PHP Examples" >PHP Examples</a></li>
                    <li><a href="../css-examples/index.html" title="User Guide" >CSS Examples</a></li>
                </ul>
            </div></div></div>
        </div>
        <div class="prepend1 append1">
            <div class="ltm" align="right">
                <a href="table-of-contents.html" title="Show Table of Content">
                    <img src="images/toc-button.png"  alt="Table of Contents" />
                </a>
            </div>
            <h2>Dregadable Web Pages</h2>

<p>Raxan for PHP enable developers to build AJAX web pages that can "gracefully degrade" (in the absence of JavaScript) while allowing access to the basic content and functionality of the page. This type of progressive enhancement allows the page to take advantage of modern browser features while still remaining presentable where such features are not present.</p>

<p>To enable the progressive enhancement features of a web page, you must declare and set the property $degradable="true" within the page class:</p>

<pre><code>&lt;?php
    class NewPage extends RaxanWebPage {

        protected $degradable = true;

        protected function doSomething($e) {
            ;
        }
    }

?&gt;
</code></pre>

<p>Once the page is made degradable, events can be invoked from the page using hyperlinks, form submit buttons and image maps.</p>

<pre><code>&lt;?php require_once('raxan/pdi/autostart.php'); ?&gt;

&lt;a href="#" xt-bind="click,doSomething"&gt;Click Here&lt;/a&gt;
&lt;div id="msgbox"&gt;&lt;/div&gt;

&lt;?php
    class NewPage extends RaxanWebPage {

        protected $degradable = true;

        protected function doSomething($e) {
            $this-&gt;msgbox-&gt;text('I am working :)');
        }
    }

?&gt;
</code></pre>

<hr />

<p><a href="state-management.html">State Management >></a></p>

        </div>
        <div class="tpb pad" style="text-align:right">
            <div class="right ltm">
                <a href="table-of-contents.html" title="Back to Table of Content">
                    <img src="images/toc-button.png"  alt="Table of Contents" />
                </a>
            </div>
        </div>
    </div>
</body>

</html>

